package com.axc.gallery2;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;

/**
 * 关闭所有Activity 
 *
 */
public class CloseApplication {
	public static List<Activity> activityList = new ArrayList<Activity>(); 
	    public static void exitClient(Context context) 
	    { 
	        // 关闭所有Activity 
	        for (int i = 0; i < activityList.size(); i++) 
	        { 
	            if (null != activityList.get(i)) 
	            { 
	                activityList.get(i).finish(); 
	            } 
	        } 
	        //ActivityManager activityMgr= (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE );
	        //activityMgr.killBackgroundProcesses(context.getPackageName()); 
	        //System.exit(0); 
	    } 
}
